#include <cstdio>

int s[ 10000001 ], cnt[ 10000001 ], n, maxn;

int find( int root )
{
    if ( !s[ root ] )
        return root;
    return s[ root ] = find( s[ root ] );
}

void work( )
{
    int i, a, b;
    maxn = 1;
    for ( i = 1; i <= 10000000; i++ )
    {
        s[ i ] = 0;
        cnt[ i ] = 1;
    }
    for ( i = 0; i < n; i++ )
    {
        scanf("%d%d", &a, &b);
        a = find( a );
        b = find( b );
        if ( a != b )
        {
            s[ a ] = b;
            cnt[ b ] += cnt[ a ];
            if ( maxn < cnt[ b ] )
                maxn = cnt[ b ];
        }
    }
    printf("%d\n", maxn);
}

int main( )
{
    while ( scanf("%d", &n) != EOF )
        work( );
    return 0;
}
